output {
  elasticsearch {
    hosts => <%= @elasticsearch_nodes.map { |node| node + ":9200" }.inspect %>
    manage_template => false
    flush_size => 1024
  }
<% if @enable_mqtt -%>
  mqtt {
    host => "<%= @mqtt_hostname %>"
    port => <%= @mqtt_port %>
    topic => "<%= @mqtt_topic %>"
    username => "<%= @mqtt_username %>"
    password => "<%= @mqtt_password %>"
    ssl => true
    ca_file => "/etc/logstash/mqtt-root-CA.pem.crt"
  }
<% end -%>

}
